package com.yx.china.project.api;
import com.yx.china.project.entities.Payment;
import com.yx.china.project.entities.ResponseResult;
import com.yx.china.project.service.PayService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
@Slf4j
public class OrderApi {
    @Resource
    private PayService payService;
    @GetMapping("/order/get/{id}")
    public ResponseResult<Payment> getPayment(@PathVariable("id") Long id){
        return payService.getPaymentById(id);
    }

    @GetMapping(value = "/order/timeout")
    public String timeOut()  {
        return payService.timeOut();
    }
}
